# Create your tasks here
from __future__ import absolute_import, unicode_literals
from celery import shared_task
from utitls import send_sms_email


@shared_task
def add(x, y):
    return x + y


@shared_task
def reg_send_mail(title, context, to_mail):
    res = send_sms_email.my_send_mail(title, context, to_mail)

    success_context = '向{}邮箱送注册验证码成功,信息内容:{}'.format(to_mail, context)
    fail_context = "向{}发送邮箱验证码失败".format(to_mail)

    if res == 1:
        return success_context
    return fail_context
